package com.example.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.entity.Content;
import com.example.repository.ContentRepository;

@Service
public class ContentService {

	@Autowired
	private ContentRepository contentRepository;//业务层需要持有对应的持久化层对象
	
	public List<Content> getItem(){
		
		return (List<Content>) contentRepository.findAll();
				
	}
	
	public Content getID(Integer id){
		return contentRepository.findOne(id);
	}
}
